package net.sky.oa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 文档类型表
 * DocType. @author hond
 */
@Entity
@Table(name = "DOC_TYPE")//文档类型表
public class DocType implements Serializable{

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private String name;    //类型名称
	private String mark;    //类型标识
	private Date createtime;//创建时间
	private String desn;    //类型描述
	private Integer status;    //状态
	private SysEmployee user; //创建人

	// Constructors

	/** default constructor */
	public DocType() {
	}

	/** minimal constructor */
	public DocType(Long id) {
		this.id = id;
	}
	
	@Id 
	@SequenceGenerator(name="SQ_DOCTYPE_ID",sequenceName="SQ_DOCTYPE_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_DOCTYPE_ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NAME", length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "MARK", length = 20)
	public String getMark() {
		return this.mark;
	}

	public void setMark(String mark) {
		this.mark = mark;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATETIME", length = 7)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Column(name = "DESN", length = 100)
	public String getDesn() {
		return this.desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}



	public void setUser(SysEmployee user) {
		this.user = user;
	}

}